$(function (){
	var $loginEffect = $(".loginEffect");
	if($loginEffect.length>0){//login
		//validate email 
		var fnValidateEmail = function(){
			return true;
		}
		var validateJson = [
			{
				isTip:1,
				tip:"请填写邮箱地址",
				isblurAjax:1,
				blurCallback:fnValidateEmail,
				blurAjaxErrorMsg:"此邮箱未注册",
				isBlurRep:1,
				blurRegExp:/^([a-z0-9A-Z]+[_\-|\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\.)+[a-zA-Z]{2,}$/,
				formatErrorMsg:"邮箱格式错误"
			},{
				isTip:0,
				isblurAjax:0
			}	
		];
		$(".loginEffect .effectInput").jEffectInput(validateJson);
	}
	
	
	//register
	var $register_content = $(".register_content");
	if($register_content.length>0){
		var fnValidateEmail = function(){
			return true;
		}
		var fnRepeatPwd = function(){
			var flag = false;
			var $input = $(".pwdBlock .effectInput");
			var val1  = $input.eq(0).find("input").val();
			var val2  = $input.eq(1).find("input").val();
			if(val1==val2) flag = true;
			return flag;
		}
		var validateJson = [
			{
				isTip:1,
				tip:"请填写邮箱地址",
				isblurAjax:0,
				isBlurRep:1,
				blurRegExp:/^([a-z0-9A-Z]+[_\-|\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\.)+[a-zA-Z]{2,}$/,
				formatErrorMsg:"邮箱格式错误"
			},{
				isTip:1,
				tip:"请修改你的密码",
				isblurAjax:0,
				isBlurRep:1,
				blurRegExp:/^.{1,10}$/,
				formatErrorMsg:"密码格式错误,密码为1-10位"
			},{
				isTip:1,
				tip:"请再次填写密码",
				isblurAjax:1,
				blurCallback:fnRepeatPwd,
				blurAjaxErrorMsg:"密码填写的不一致",
				isBlurRep:1,
				blurRegExp:/^.{1,10}$/,
				formatErrorMsg:"密码格式错误,密码为1-10位"
			},{
				isTip:1,
				tip:"请填写昵称名",
				isblurAjax:0,
				isBlurRep:0
			}
		];
		$(".register_content .effectInput").jEffectInput(validateJson);
		$(".registerSubmit").click(function (){
			return false;
		});
	}
	
});
	